Daniel Stenberg [Tue, 25 Apr 2023 11:06:01 +0000 (13:06 +0200)]
curl_path: bring back support for SFTP path ending in /~
libcurl used to do a directory listing for this case (even though the
documentation says a URL needs to end in a slash for this), but 4e2b52b5f7a3 modified the behavior.
This change brings back a directory listing for SFTP paths that are
specified exactly as /~ in the URL.
Reported-by: Pavel Mayorov
Fixes #11001
Closes #11023
Samuel Henrique [Sun, 9 Mar 2025 10:41:25 +0000 (10:41 +0000)]
runtests.pl: Increase variance of random seed used for tests's port designation
Patched on Debian to add day, hour and min to the seed, e.g.: 201912091530
The version of curl we ship on bookworm is too prone to port conflicts on tests,
this is the least intrusive workaround as it makes each retry use a different seed.
Gbp-Pq: Name runtests_port_random_seed_variance.patch
Gbp-Pq: Name runtests.pl-Increase-variance-of-random-seed-used-for-tes.patch
Daniel Stenberg [Fri, 3 Jan 2025 15:22:27 +0000 (16:22 +0100)]
[PATCH] netrc: 'default' with no credentials is not a match
Test 486 verifies.
Reported-by: Yihang Zhou
Closes #15908
Backported by: Dr. Tobias Quathamer <toddy@debian.org>
Changes:
* Refresh patch context for lib/netrc.c
* Use tests/data/Makefile.inc to add new test instead of
tests/data/Makefile.am, because that has only been
introduced in later versions of curl.
* Replace "%LOGDIR" with "log" due to its absence in bookworm.
Daniel Stenberg [Fri, 15 Nov 2024 10:06:36 +0000 (11:06 +0100)]
[PATCH] netrc: address several netrc parser flaws
- make sure that a match that returns a username also returns a
password, that should be blank if no password is found
- fix handling of multiple logins for same host where the password/login
order might be reversed.
- reject credentials provided in the .netrc if they contain ASCII control
codes - if the used protocol does not support such (like HTTP and WS do)
Reported-by: Harry Sintonen
Add test 478, 479 and 480 to verify. Updated unit 1304.
Closes #15586
Backported by: Matheus Polkorny <mpolkorny@gmail.com>
Based on the work of Marc Deslauriers <marc.deslauriers@ubuntu.com>
for curl 7.81.0-1ubuntu1.20.
Changes:
- Refresh patch context.
- Adjust `%LOGDIR/` to 'log/' due to its absence in bookworm.
- Replaces the previous usage of the state_login, state_password, and
state_our_login variables with the found_state enum, which includes the
values NONE, LOGIN, and PASSWORD. As a result, all conditionals and memory
management logic associated with these variables were updated.
- Updates to use password and login instead of s_password and s_login,
which do not exist in the Bookworm version. This change preserves the
same logic while adapting the code to the current structure.
- test478 is disabled as this version of curl does not support searching
for a specific login in the netrc file.
(see https://github.com/curl/curl/issues/8241)
- test480 is disabled as this version of curl does not support quoted or
escaped strings in the netrc file.
(see https://github.com/curl/curl/issues/8908)
Daniel Stenberg [Wed, 9 Oct 2024 09:27:29 +0000 (11:27 +0200)]
[PATCH] tests: 780 - 783, new HSTS tests
test780: verify updated HSTS data in response header
test781: HSTS update expiry, with parent includeSubDomains domain
present
test782: HSTS update expiry, with two includeSubDomains domains present
test783: HSTS update expiry, removing includesubdomains in update
Backported by: Aquila Macedo Costa <aquilamacedo@riseup.net>.
Changes:
- Adjust `tests/data/Makefile.inc` to include new HSTS tests (780 - 783).
- Updates 'Debug' to 'debug' in test data files (`test780`, `test781`,
`test782`, `test783`) to align with curl conventions in bookworm and
ensure consistency in feature definitions.
- Additionally, `%LOGDIR` is replaced with log in the test files due to
its absence in curl bookworm.
Backported to Debian by Carlos Henrique Lima Melara <charles@debian.org>.
Changes:
- In this version, GTime2str doesn't return CURLcode, so change that to NULL.
- Also change test helper function to match the correct type and pass the
correct arguments. In this version, GTime2str doesn't take struct dynbuf *.
It's aimed to not FTBFS if someone build the package with --enable-debug.
When disabling all protocols without enabling any, the resulting
set of allowed protocols remained the default set. Clearing the
allowed set before inspecting the passed value from --proto make
the set empty even in the errorpath of no protocols enabled.
Co-authored-by: Dan Fandrich <dan@telarity.com> Reported-by: Dan Fandrich <dan@telarity.com> Reviewed-by: Daniel Stenberg <daniel@haxx.se> Closes: #13004
Backported by: Guilherme Puida Moreira <guilherme@puida.xyz>
* Small change in the Makefile to add a new test.
Daniel Stenberg [Thu, 14 Sep 2023 21:28:32 +0000 (23:28 +0200)]
[PATCH] cookie: remove unnecessary struct fields
Plus: reduce the hash table size from 256 to 63. It seems unlikely to
make much of a speed difference for most use cases but saves 1.5KB of
data per instance.
Closes #11862
Backported by: Samuel Henrique <samueloph@debian.org>
Jay Satiro [Sat, 30 Sep 2023 07:40:02 +0000 (03:40 -0400)]
[PATCH] socks: return error if hostname too long for remote resolve
Prior to this change the state machine attempted to change the remote
resolve to a local resolve if the hostname was longer than 255
characters. Unfortunately that did not work as intended and caused a
security issue.
Name resolvers cannot resolve hostnames longer than 255 characters.
Bug: https://curl.se/docs/CVE-2023-38545.html
Backported by: Samuel Henrique <samueloph@debian.org>
Daniel Stenberg [Wed, 2 Aug 2023 21:34:48 +0000 (23:34 +0200)]
[PATCH] http: return error when receiving too large header set
To avoid abuse. The limit is set to 300 KB for the accumulated size of
all received HTTP headers for a single response. Incomplete research
suggests that Chrome uses a 256-300 KB limit, while Firefox allows up to
1MB.
Closes #11582
Backport to Debian by Carlos Henrique Lima Melara <charlesmelara@riseup.net>
The non-OpenLDAP code paths are less tested, less featureful, less secure,
and omitted in the build system by accident. It has been discovered that this
also mitigates curl not being able to make LDIF output when attributes have
binary values.
Gbp-Pq: Name Use-OpenLDAP-specific-functionality.patch
Daniel Stenberg [Tue, 25 Apr 2023 06:28:01 +0000 (08:28 +0200)]
[PATCH] lib: unify the upload/method handling
By making sure we set state.upload based on the set.method value and not
independently as set.upload, we reduce confusion and mixup risks, both
internally and externally.
Dan Fandrich [Mon, 17 Apr 2023 23:57:17 +0000 (16:57 -0700)]
[PATCH] runtests: don't try to stop stunnel before trying again
Calling stopserver() before retrying stunnel due to an error would stop
the dependent server (such as HTTP) meaning stunnel would have nothing
to talk to when it came up. Don't try to force a stop when it didn't
actually start. Also, don't mark the server as bad for future use when
it starts up on a retry.
Reported-by: eaglegai at github Tested-by: eaglegai at github
Fixes #10976
Backported by: Aquila Macedo Costa <aquilamacedo@riseup.net>.
Changes:
- Apply the changes to `runtests.pl` instead of `servers.pm`, as
`servers.pm` does not exist in this version of bookworm.
When the user specified an IPv6 address to be used as an LDAP server,
curl will fail to properly enclose it in square brackets, which causes
the connection to fail because the host address cannot be
distinguished from the port:
$ curl -v ldap://[fd42:be5:e632:a6b3:216:3eff:feb1:5bc4]:389
...
* LDAP local: Cannot connect to ldap://fd42:be5:e632:a6b3:216:3eff:feb1:5bc4:389, Bad parameter to an ldap routine
...
Fix this by always enclosing the IPv6 address in square brackets.
Stefan Eissing [Tue, 28 Feb 2023 09:07:21 +0000 (10:07 +0100)]
[PATCH] Fixing unix domain socket use in https connects.
- refs #10633, when h2/h3 eyeballing was involved, unix domain socket
configurations were not honoured
- configuring --unix-socket will disable HTTP/3 as candidate for eyeballing
- combinatino of --unix-socket and --http3-only will fail during initialisation
- adding pytest test_11 to reproduce
Simon McVittie [Tue, 22 Nov 2022 21:20:51 +0000 (21:20 +0000)]
Remove curl's LDFLAGS from curl-config --static-libs
On current Debian bookworm, the LDFLAGS consist of
-L/usr/lib/${triplet}/mit-krb5 originating from
`pkg-config --libs-only-L mit-krb5-gssapi` from krb5-multidev, plus
some linker options that are intended for curl itself rather than for
dependent packages. None of these are really desirable, and they create
divergence between architectures that would prevent libcurl-*-dev from
being Multi-Arch: same.
The -L flag is not really needed, for the same reason that -L@libdir@
isn't. curl Build-Depends on libkrb5-dev, which doesn't need a special
-L flag to find libgssapi_krb5, and the various libcurl-*-dev packages
have Suggests on libkrb5-dev rather than on krb5-multidev for static
linking.
The other options (currently `-Wl,-z-relro -Wl,-z,now`) are intended
for libcurl itself, and if dependent packages want those options then
they should set them from their own packaging.
Bug-Debian: https://bugs.debian.org/1024668
Forwarded: not-needed Signed-off-by: Simon McVittie <smcv@collabora.com>
Gbp-Pq: Name Remove-curl-s-LDFLAGS-from-curl-config-static-libs.patch
mention of @includedir@ and @libdir@ from the script. On Debian, the actual
header and library directories are architecture-dependent, but will always be
in the C compiler's default search path, so -I and -L options are not
necessary (and may be harmful in multi-arch environments.)
Gbp-Pq: Name 11_omit-directories-from-config.patch
Simon McVittie [Tue, 22 Nov 2022 20:43:41 +0000 (20:43 +0000)]
build: Divide mit-krb5-gssapi link flags between LDFLAGS and LIBS
From the comments nearby about not having --libs-only-L, it looks as
though the intention was to apply a split like this to all dependency
libraries where possible, and the only reason it was not done for
Kerberos is that krb5-config doesn't have that feature and pkg-config
was originally not supported here. For example, zlib, libssh and librtmp
all have their flags from pkg-config split in this way.
Now that pkg-config is supported here, we can do the intended split.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Gbp-Pq: Name build-Divide-mit-krb5-gssapi-link-flags-between-LDFLAGS-a.patch
* d/p/0001-http_chunks-reset...: New patch to fix memory leak:
- Thanks to Daniel Stenberg and dheerajsangamkar for reporting the issue
and writing a patch